#!/bin/sh
for list_file in `ls -1`
        do
            # echo 'verifing file ' ${list_file}
             list_file=`echo ${list_file} | sed  "s/\[/\\\\\\\[/g"| sed  "s/\]/\\\\\\\]/g"`
             patch_path=`find  ../20090418/ -name ${list_file} `
             patch_path=`echo ${patch_path} | sed  "s/\\\\\\\\\[/\[/g"| sed  "s/\\\\\\\\\]/\]/g"`
             list_file=`echo ${list_file} | sed  "s/\\\\\\\\\[/\[/g"| sed  "s/\\\\\\\\\]/\]/g"`
             echo 'patch_path:' $patch_path >>validate.log
             echo 'list_file:' $list_file >>validate.log
             if [ "${patch_path}"x = ""x ]
             then 
             echo '[NOT FOUND]'${list_file} 
             else
             #echo 'patch path:'${patch_path}
             svn_md5=`md5sum ${list_file} |awk '{print $1}'`
             patch_md5=`md5sum ${patch_path} |awk '{print $1}'`
             echo 'svn_md5:' $svn_md5 >>validate.log
             echo 'patch_md5:' $patch_md5 >>validate.log
             if [ ${svn_md5} = ${patch_md5} ]
             then
                 echo '[MATCH] '${list_file} 
             else
              svnsize=`ls -l $list_file |awk '{print $5}'`  
              patchsize=`ls -l $patch_path |awk '{print $5}'`
              echo '[ERROR] '${list_file} 'svn size:' $svnsize ', patch size:' $patchsize
             fi
             fi
                
        done
